<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="../common.inc" %>    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base target="_self">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link href="./css/style1.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="./js/form.js"></script>
<script type="text/javascript" language="javascript">
<!--
	function showHidden(id){
		var obj = document.getElementById(id);
		if(obj.style.display == "none"){
			document.getElementById(id).style.display = "block";
			document.getElementById("img"+id).src = "./images/nolines_minus.gif";
		}else{
			document.getElementById(id).style.display = "none";
			document.getElementById("img"+id).src = "./images/nolines_plus.gif";
		}
	}
	
	function exportEmployeeLevel(){
		document.viewEmployeeLevelForm.action = "./employeeManage.do?action=uploadExportFile";
		document.viewEmployeeLevelForm.target = "_self";
		document.viewEmployeeLevelForm.submit();
	}
-->
</script>
</head>
<body>
<form name="viewEmployeeLevelForm" action="" method="post">
	<table class="table_frame">
		<tr>
			<td>
				<table class="table_title1">
					<tr>
						<td class="title_lab">
							员工信用等级
						</td>
					</tr>
					<tr>
						<td valign="bottom" class="a_tools" style="padding-left: 3px;padding-top: 4px;">
							<a class="export" href="javascript:exportEmployeeLevel();" hidefocus="true">导出Excel表</a>
						</td>
					</tr>
					<tr><td height="2"></td></tr>
				</table>
			</td>
		</tr>
		<tr>
			<td>
				<table class="table_title2">
					<c:forEach var="department" items="${departments}">
					<c:if test="${not empty department.users}">
					<tr>
						<td valign="top">
							<table class="table_add">
								<tr onclick="showHidden('${department.id}')">
									<td class="title_top">
										<img id="img${department.id}" src="./images/nolines_minus.gif">
										${department.deptName}
									</td>
								</tr>
							</table>
						</td>
					</tr>
					<tr id="${department.id}" style="display: block;">
						<td>
							<table class="table_style">
								<tr>
									<td class="title" width="8"></td>
									<td class="title" width="12%">姓名</td>
									<td class="title" width="15%">信用等级</td>
									<td class="title" width="15%">办公电话</td>
									<td class="title" width="15%">手机</td>
									<td class="title" width="15%">生日</td>
									<td class="title" width="" align="left">电子邮件</td>
								</tr>
								<c:forEach var="user" items="${department.users}" varStatus="u">
								<tr onmouseover="onmousemoveChange(this,'img${user.id + u.count}')" onmouseout="onmouseoutChange(this,'img${user.id + u.count}')">
									<td height="16" width="8" align="right"><img id="img${user.id + u.count}" src="./images/table_sign2.bmp"></td>
									<td>${user.userName}</td>
									<td title="<c:choose><c:when test='${user.creditLevel == 1}'><fmt:message key='employee.select.level1'/></c:when><c:when test='${user.creditLevel == 2}'><fmt:message key='employee.select.level2'/></c:when><c:when test='${user.creditLevel == 3}'><fmt:message key='employee.select.level3'/></c:when><c:when test='${user.creditLevel == 4}'><fmt:message key='employee.select.level4'/></c:when><c:when test='${user.creditLevel == 5}'><fmt:message key='employee.select.level5'/></c:when><c:otherwise></c:otherwise></c:choose>">
									<c:choose>
										<c:when test="${user.creditLevel == 1}">
											<img class="btn_img" src="./images/e_level.bmp">&nbsp;&nbsp;
											<img class="btn_img" src="./images/e_level.bmp">&nbsp;&nbsp;
											<img class="btn_img" src="./images/e_level.bmp">&nbsp;&nbsp;
											<img class="btn_img" src="./images/e_level.bmp">&nbsp;&nbsp;
											<img class="btn_img" src="./images/e_level.bmp">
										</c:when>
										<c:when test="${user.creditLevel == 2}">
											<img class="btn_img" src="./images/e_level.bmp">&nbsp;&nbsp;
											<img class="btn_img" src="./images/e_level.bmp">&nbsp;&nbsp;
											<img class="btn_img" src="./images/e_level.bmp">&nbsp;&nbsp;
											<img class="btn_img" src="./images/e_level.bmp">
										</c:when>
										<c:when test="${user.creditLevel == 3}">
											<img class="btn_img" src="./images/e_level.bmp">&nbsp;&nbsp;
											<img class="btn_img" src="./images/e_level.bmp">&nbsp;&nbsp;
											<img class="btn_img" src="./images/e_level.bmp">
										</c:when>
										<c:when test="${user.creditLevel == 4}">
											<img class="btn_img" src="./images/e_level.bmp">&nbsp;&nbsp;
											<img class="btn_img" src="./images/e_level.bmp">
										</c:when>
										<c:otherwise>-</c:otherwise>
									</c:choose>
									</td>
									<td>${user.subPhone}</td>
									<td>${user.mobile}</td>
									<td><fmt:formatDate value="${user.birthday}" pattern="yyyy-MM-dd"/></td>
									<td>${user.email}</td>
								</tr>
								</c:forEach>
							</table>
						</td>
					</tr>
					</c:if>
					</c:forEach>
				</table>
			</td>
		</tr>
	</table>
</form>	
</body>
</html>